import com.dmotiko.general.*
import com.dmotiko.bolacua.*

class RoomFeatureComponent
extends BaseClip {
	
	private var container:MovieClip;
	private var aFeatures:Array;
	
	private function RoomFeatureComponent() {
		super();
	}
	
	private function refreshData():Void {
		var nX:Number = 0;
		var nY:Number = 0;
		var nRows:Number = Math.ceil( data.length / 3 );
		var nCount:Number = 0;
		this.container = this.createEmptyMovieClip("container", 1);
		for (var i:Number = 0; i < data.length; i++) {
			var feature = this.container.attachMovie("roomFeature", "feature" + i, i);
			feature.setData( data[i] );
			feature._x = nX;
			feature._y = nY;
			if(feature.txtLabel.textHeight > 18){
				nY += feature.txtLabel.textHeight + 6;
			} else {
				nY += feature._height - 3;
			}
			nCount++;
			if (nCount == nRows) {
				nY = 0;
				nX += 140;
				nCount = 0;
			}
		}
		
	}
		
}